﻿<style>
#radnici_pregled{
	width:1000px;
}
#radnici_pregled .info{
	display:block;
	float:right;
	background:{{$highlight}};
	color:{{$highlighttext}};
	padding:2px;
	font-size:11px;
}
#radnici_pregled table{
	width:100%;
	margin-top:5px;
}
#radnici_pregled table tr{
	cursor:default;
}
#radnici_pregled table tr.selected{
	background:#ccc;
	color:#555;
}
#radnici_pregled table tr:hover{
	background:#2577BA;
	color:#FFF;
}
#radnici_pregled table tr td{
	padding:2px 4px;
	vertical-align:top;
	border-bottom:1px solid #aaa;
}
#radnici_pregled table tr#head{
	font-weight:bolder;
}
#radnici_pregled table tr#head:hover{
	background:none;
	color:#000;
}
#radnici_pregled table tr#head td{
	border-bottom:3px double #000;
}
#radnici_pregled input[type=button]{
	width:20px;
	height:20px;
	background-position:center center;
	float:left;
	clear:none;
	padding:0px;
	margin:2px;
	cursor:pointer;
	-moz-opacity:0.2;
}
#radnici_pregled table tr:hover input[type=button],
#radnici_pregled input[type=button]:hover{
	-moz-opacity:1;
}
#radnici_pregled ul.letter_filter li#currentPage a{
	background:#2577BA;
	color:#FFF;
}
#filter_active_holder{
	width:800px;
	float:right;
	position:relative;
	margin:-10px -10px 10px 0px;
}
#filter_active_holder label{
	float:left;
	padding:8px 0px 0px 5px;
}
#filter_active_holder legend{
	color:#aaa;
}
#filter_active_holder fieldset{
	float:right;
	padding:2px 5px;
	margin:0px;
	border:1px solid #aaa;
}
select#filter_active{
	float:left;
}
</style>
<div class="area" id="radnici_pregled">
<div id="filter_active_holder">
<form method="get" action="javascript:void(0)" onsubmit="filterRadnici(this);">
<fieldset>
  <legend>Filter</legend>
  	<label for="filter_active">status:</label>
	<select id="filter_active">
	  <option value="0">svi</option>
	  <option value="1" {{$selected_fa_1}}>aktivni</option>
	  <option value="2" {{$selected_fa_0}}>neaktivni</option>
	</select>
	<label for="radnik_ime">Radnik:</label>
	<input onchange="this.value = trim(this.value)" type="text" name="radnik_ime" id="radnik_ime" value="{{$filter_radnik}}" />
	<label for="radnik_tel">telefon:</label>
	<input onchange="this.value = trim(this.value)" type="text" name="radnik_tel" id="radnik_tel" value="{{$filter_tel}}" />
	
	<label for="radnik_tip">Tip:</label>
	<select name="radnik_tip" id="radnik_tip">
		<option value="-1">---</option>
		{{%loop start radnik_tip_id}}
		<option value="{{$radnik_tip_id}}" {{$radnik_tip_selected}}>{{$radnik_tip_name}}</option>
		{{%loop end}}
	</select>
	
	<input type="submit" value="filter" />
</fieldset>
</form>
</div>
<h1>Pregled radnika</h1>
<br clear="all" />
<span class="info">{{$info}}</span>
{{$pages_start_comment}}
<ul class="letter_filter" id="active_page">
	<li>Strana: </li>
	{{%loop start page}}
	<li value="{{$page}}" {{$current_page}}><a href="javascript:void(0)" onclick="LoadRSDoc('radnici.php?p={{$page}}&akt={{$active}}&ime={{$filter_radnik}}&tel={{$filter_tel}}&tip={{$filter_tip}}','setContent')">{{$page}}</a></li>
	{{%loop end}}
</ul><br clear="all" />
{{$pages_end_comment}}
<table cellspacing="0">
  <tr id="head">
  	{{$comment_start_user}}
  	<td style="width:80px;">
		<input type="button" class="delete" style="background-image:url(gui/icons/user_act_deact.gif)" value="" onclick="selectedActiveDeactive('{{$curr_page}}','{{$active}}')" title="Aktiviraj/Deaktiviraj označene radnike" />
		<input type="button" class="delete" value="" onclick="deleteSelected('{{$curr_page}}','{{$active}}')" title="Obriši označene radnike" />
	</td>
	{{$comment_end_user}}
	<td>šifra</td>
    <td>ID kartice</td>
    <td>Ime i prezime</td>
    <td>Adresa</td>
    <td>Grupa</td>
    <td>Telefon</td>
    <td>Rodjendan</td>
	<td>radi od/do</td>
    <td>Komentar</td>
  </tr>
  {{%loop start id}}
  <tr style="{{$akt_style}}" onclick="var chk = document.getElementById('delMore_{{$id}}'); if(chk){toggleDeleteSelection(chk); chk.checked = !chk.checked;}">
  	{{$comment_start_user}}
  	<td>
		<input type="checkbox" name="delMore_{{$id}}" id="delMore_{{$id}}" value="{{$id}}" onclick="toggleDeleteSelection(this); event.stopPropagation();" />
		<input type="button" class="edit" value="" onclick="LoadRSDoc('radnici.php?a=editRadnik&id={{$id}}&cp={{$curr_page}}&act={{$active}}&ime={{$filter_radnik}}&tel={{$filter_tel}}','ypAjaxForm'); event.stopPropagation();" title="Izmeni" />
		<input type="button" class="delete" value="" onclick="deleteRadnik(this,{{$id}},'{{$first}}','{{$last}}','{{$curr_page}}','{{$active}}'); event.stopPropagation();" title="Obriši" />
	</td>
	{{$comment_end_user}}
	<td>{{$id}}</td>
    <td>{{$card_id}}</td>
    <td>{{$first}}&nbsp;{{$last}}</td>
    <td>{{$address}}</td>
    <td>{{$group}}</td>
    <td>{{$phone}}</td>
    <td>{{$birth}}</td>
	<td>{{$ugo_start}}&nbsp;-&nbsp;{{$ugo_end}}</td>
	<td style="font-size:10px;">{{$comment}}</td>
  </tr>
  {{%loop end}}
</table>
</div>
<script>
var selIds = Array();
</script>